package com.qqtech.qquan.user.service;

import com.qqtech.core.common.exception.BizzException;
import com.qqtech.core.frame.model.Result;
import com.qqtech.core.frame.service.BaseService;
import com.qqtech.qquan.user.enums.UserIdentityTypeDictEnum;
import com.qqtech.qquan.user.enums.UserVerifycodeTypeDictEnum;
import com.qqtech.qquan.user.model.UserVerifycode;

public interface UserVerifycodeService extends BaseService<UserVerifycode> {
	/**
	 * 判断验证码是否有效(是否匹配、是否在有效期)
	 * 
	 * @param identity
	 *            账号
	 * @param verifycode
	 *            验证码
	 * @param userVerifycodeType
	 *            验证码的类型
	 * @return Result
	 */
	Result checkValidCode(String identity, String verifycode, UserVerifycodeTypeDictEnum userVerifycodeType);

	/**
	 * 根据发送通道、验证业务类型生成对应的验证码并返回
	 * 
	 * @param userVerifycodeChannel
	 *            通道类型
	 * @param channelId
	 *            验证码对应的手机号或email
	 * @param userVerifycodeType
	 *            业务类型
	 * @return
	 * @throws BizzException 
	 */
	Result addVerifycode(UserIdentityTypeDictEnum userVerifycodeChannel, String channelId,
			UserVerifycodeTypeDictEnum userVerifycodeType) throws BizzException;
}